//
//  NSBundle+Emojis.m
//  LinkUsMessage_iOS
//
//  Created by lcy on 15/12/28.
//  Copyright © 2015年 lcy. All rights reserved.
//

#import "NSBundle+Emojis.h"
#import "NSBundle+YYAdd.h"

@implementation NSBundle (Emojis)

- (YYImage *)emojiFromDirectory:(NSString *)directory ofType:(NSString *)type ofIndex:(NSString *)index
{
    
    NSString *path = [[NSBundle mainBundle] pathForScaledResource:index ofType:type inDirectory:directory];
    NSData *data = [NSData dataWithContentsOfFile:path];
    
    YYImage *image = [YYImage imageWithData:data scale:2];
    image.preloadAllAnimatedImageFrames = YES;
    
    return image;
}


- (NSMutableArray *)emojisInfoFromDirectory:(NSString *)directory ofType:(NSString *)type ofName:(NSString *)name
{
    
    NSString *path = [[NSBundle mainBundle] pathForScaledResource:name ofType:type inDirectory:directory];
    
    NSMutableArray *array = [NSMutableArray arrayWithContentsOfFile:path];
    
    return array;
}

@end
